<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script type="text/javascript" src="./angular.min.js"></script>
<script type="text/javascript" src="./jquery-1.8.3.min.js"></script>
</head>
<body>
<div class="main" ng-app="myApp" ng-controller="myController">
	{{333+666}}{{username}}
	<button ng-click="getData()">按钮</button>
</div>
<!-- <script>
angular.module('myApp',[])
.controller('myController',['$scope','$http',function($scope,$http){
	$scope.username = "张三";	
    $scope.getData = function(){
    	$http({
            method:'POST',
            headers:{
                //在请求的时候设置请求头，当然请求有很多种，我们以这种为例
            'content-type':'application/x-www-form-urlencoded'
            },
            url:'http://127.0.0.1/',
            data:{
                //字符串或者对象，这个对象包含了请求体的所有内容，会被发送给服务器
                myUrl:'http://api.douban.com/v2/movie/in_theaters'
            }
        }).then(function success(result){
            console.log(result);
        },function error(error){
            console.log(error);
        });
    }
}]);
</script> -->
<script type="text/javascript">
var myApp = angular.module('myApp',[]);
myApp.controller('myAppControl',['$scope','$http',function($scope,$http){
	$http({
	    method: 'get',
	    url: 'https://api.github.com',
	}).success(function (msg) {
	    console.log(msg);
	}); 
}]);
</script>
<!-- <script type="text/javascript">
angular.module('myApp',[])
    .controller('myController',['$scope','$http',function($scope,$http){
        $scope.getData = function(){
            //var myUrl = 'http://c.m.163.com/nc/article/headline/T1348647853363/0-10.html';
            $http({
                method: 'JSONP',
                url: 'http://c.m.163.com/nc/article/headline/T1348647853363/0-10.html?callback=JSON_CALLBACK',
            }).success(function (msg) {
                console.log(data);
            });
        }
    }]);
</script> -->
<!-- <script type="text/javascript">
var myApp = angular.module("myApp",[]); 
// var json = "http://127.0.0.1/angular/json.json";
// var json = "https://api.douban.com/v2/book/1220562";
var json = "http://c.m.163.com/nc/article/headline/T1348647853363/0-10.html";
myApp.controller("myAppControl",['$scope',"$http",function($scope,$http){
	$scope.username = "张三";
	$http.get(json).then(function(res){
		console.log(res);
	});
}]);
</script> -->
</body>
</html>